﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Threading;



namespace IDE_week2_Forms_project
{
    public partial class Form1 : Form
    {
        bool language = false;
        public Form1()
        {
            InitializeComponent();

        }

        class Class1
        {
            public static Random random = new Random();

            public static void MakeRandomNumber(int[] numbers)
            {
                int i, value;

                for (i = 0; i < 10; i++) numbers[i] = 0;

                for (i = 1; i < 10; i++)
                {
                    value = random.Next(0, 9);
                    numbers[value] = numbers[value] + 1;
                }
            }
        }
        

        private void button1_Click(object sender, EventArgs e)
        {
            this.Icon = Properties.Resources.Icon1;
        }

        private void button5_Click(object sender, EventArgs e)
        {
            Form2 frm = new Form2();
            frm.Show();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            this.Icon = default(Icon);
        }

        private void ChangeLanguage(string lang)
        {
            foreach (Control c in this.Controls)
            {
                ComponentResourceManager resources =
                      new ComponentResourceManager(typeof(Form1));
                resources.ApplyResources(c, c.Name, new CultureInfo(lang));
            }
        }
       
        
        private void button3_Click(object sender, EventArgs e)
        {
            
            
            if (language)

                ChangeLanguage("bg-BG");
            else
                ChangeLanguage("en");
            language = !language;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int[] numbers = new int[10];
            Class1.MakeRandomNumber(numbers);
            label1.Text = numbers[0] + ", " + numbers[1] + ", " + numbers[2];

        }

    }
}
